using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DeliciousAPI;

namespace DeliciousToolbar
{
    public partial class AddBookmarkForm : Form
    {
        private string Url;
        private string Description;
        
        public Post NewPost
        {
            get { return _NewPost; }
            private set { _NewPost = value; }
        } private Post _NewPost = null;
        
        public AddBookmarkForm(string url, string description)
        {
            Url = url;
            Description = description;
            InitializeComponent();
        }

        private void AddBookmarkForm_Load(object sender, EventArgs e)
        {
            this.UrlTB.Text = Url;
            this.DescriptionTB.Text = Description;
        }
        
        private void AddBtn_Click(object sender, EventArgs e)
        {
            Post NP = new Post();
            NP.Href = this.UrlTB.Text;
            NP.Description = this.DescriptionTB.Text;
            NP.Tag = this.TagsTB.Text;
            NP.Extended = this.NotesTB.Text;
            
            NewPost = NP;
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void CancelBtn_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}